package com.javasix;

public class ClimbThread implements Runnable {

    private String name;
    private int time; //爬100米时长
    private int num; //num

    public ClimbThread(){

    }
    public ClimbThread(String name,int time,int num){
        this.name=name;
        this.time=time;
        this.num=num;
    }

    @Override
    public void run() {
        if(num>0){
            for (int i = 0; i < num; i++) {
               try {
                   Thread.sleep(time);
               }catch (Exception e){
                   e.printStackTrace();
               }
                System.out.println(name+"爬完100米");
            }
        }
        System.out.println(name+"到达终点");
    }
}
